package com.zhk.entry.test;

import java.lang.reflect.Proxy;
import java.util.Observable;
import java.util.Observer;

/**
 * @Description 被观察者   https://www.cnblogs.com/niechen/p/7348070.html
 * @Author zhanghk
 * @Date 2021/4/6 17:09
 */
public class Baby extends Observable {

    public void cry(String news)
    {
        setChanged();
//        addObserver((Observer) Proxy.newProxyInstance(Person.class.getClassLoader(),Person.class.getInterfaces(),new Nanny()));
        this.notifyObservers(news);
    }

}
